import request from '@/utils/request'

export function page(data) {
  return request({
    url: '/exam/page',
    method: 'post',
    data
  })
}

export function deleteExam(examId) {
  return request({
    url: `/exam/delete/${examId}`,
    method: 'post'
  })
}

export function deleteBatch(data) {
  return request({
    url: '/exam/delete/batchDelete',
    method: 'post',
    data
  })
}

export function save(data) {
  return request({
    url: '/exam/create',
    method: 'post',
    data
  })
}
export function findById(examId) {
  return request({
    url: `/exam/findById/${examId}`,
    method: 'post'
  })
}
export function update(data) {
  return request({
    url: '/exam/update',
    method: 'post',
    data
  })
}

export function myExams() {
  return request({
    url: '/exam/myExams',
    method: 'post',
  })
}

export function fetchDetail(id) {
  return request({
    url: `/exam/preview/${id}`,
    method: 'get',
  })
}